import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzBreadCrumbModule } from 'ng-zorro-antd/breadcrumb';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { NzMenuModule } from 'ng-zorro-antd/menu';
import {
  NzTableModule,
  NzTableLayout,
  NzTablePaginationPosition,
  NzTablePaginationType,
  NzTableSize
} from 'ng-zorro-antd/table';
import { NzPaginationModule } from 'ng-zorro-antd/pagination';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzMessageModule, NzMessageService } from 'ng-zorro-antd/message';
import { NzPopconfirmModule } from 'ng-zorro-antd/popconfirm';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { RouterLink, RouterOutlet } from '@angular/router';
//使用了form-group和formControlName的情况下，在所属模块的根module.ts文件中，需要引入ReactiveFormsModule
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DragDropModule } from '@angular/cdk/drag-drop';
import {
  FormControl,
  FormGroup,
  NonNullableFormBuilder,
  Validators
} from '@angular/forms';

import { SafeHtmlPipe } from '@app/pipes/Safe.pipe'; //安全管道

/*****antd的模块********/
const NgZorroAntd = [
  FormsModule,
  ReactiveFormsModule,
  RouterLink,
  RouterOutlet,
  NzButtonModule,
  NzModalModule,
  NzMessageModule,
  NzIconModule,
  NzGridModule, // 栅格
  NzLayoutModule, // 布局layout
  NzBreadCrumbModule, // Breadcrumb面包屑
  NzDropDownModule, // Dropdown下拉菜单
  NzMenuModule, // Menu导航菜单
  NzPaginationModule, // Pagination分页
  NzSelectModule, // Select选择器
  NzInputModule, // Input输入框
  NzFormModule, // Form表单
  NzPopconfirmModule, //气泡确认框
  NzTableModule, //表格相关组件
  NzDividerModule, //分割线
  DragDropModule //拖拽模块
];
@NgModule({
  declarations: [],
  imports: [CommonModule, SafeHtmlPipe, ...NgZorroAntd],
  exports: [CommonModule, SafeHtmlPipe, ...NgZorroAntd]
})
export class ShareModule {}
export {
  NzMessageService,
  FormControl,
  FormGroup,
  NonNullableFormBuilder,
  Validators,
  NzTableLayout,
  NzTablePaginationPosition,
  NzTablePaginationType,
  NzTableSize
};
